
def internal_1():
  """Internal call DN1 to DN2, abnormal release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg1.ReleaseCall()

def internal_2():
  """Internal call DN1 to ACD2,  release DN2"""
  AilAg1.MakeCall(ACD2)
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()

def internal_1a():
  """Internal call DN1 to DN2, abnormal release DN1"""
  AilAg2.MakeCall(DN1)
  AilAg2.ReleaseCall()

def internal_3():
  """Internal call DN1 to ACD2,  abnormal release DN1"""
  AilAg2.SetNotReady()
  AilAg1.MakeCall(ACD2)
  AilAg1.ReleaseCall()
  AilAg2.SetReady()

def internal_4():
  """Internal call DN1 to ACD2 agent NotReady Ready"""
  AilAg2.SetNotReady()
  AilAg1.MakeCall(ACD2)
  AilAg2.SetReady()
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()

def internal_5():
  """Internal call DN1 to ACD3 agent NotReady Ready"""
  AilAg3.SetNotReady()
  AilAg1.MakeCall(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()


def internal_6():
  """Internal call DN1 to  DN2, two step transfer to DN3, release DN3"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()
  
def internal_7():
  """Internal call DN1 to  DN2, DN2 init transfer to DN3, release DN1, release DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()
  
def internal_8():
  """Internal call DN1 to  DN2, DN2 init transfer to DN3, release DN1, DN3 answer, release DN3"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg1.ReleaseCall()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()  
  
def internal_9():
  """Internal call DN1 to  DN2, DN1 init transfer to DN3, release DN2, DN3 answer, release DN3"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg1.InitiateTransfer(DN3)
  AilAg2.ReleaseCall()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()   

def internal_10():
  """Internal call DN1 to  DN2, DN1 init transfer to DN3, DN2 answer, DN3 answer, release DN3, release DN2"""
  AilAg1.MakeCall(DN2)
  AilAg1.InitiateTransfer(DN3)
  AilAg2.AnswerCall()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()  
  AilAg2.ReleaseCall()    

def internal_11():
  """Internal call DN1 to  DN2, DN1 init transfer to DN3,  DN3 answer, DN2 answer, release DN3, release DN2"""
  AilAg1.MakeCall(DN2)
  AilAg1.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg2.AnswerCall()
  AilAg3.ReleaseCall()  
  AilAg2.ReleaseCall() 
  
def internal_12():
  """Internal call DN1 to  DN2, two step transfer to DN3, release DN3"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()  

def internal_13():
  """Internal call DN1 to  DN2, two step transfer to DN3, abnormal release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg2.ReleaseCall()
  AilAg1.ReleaseCall()

def internal_13a():
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def internal_13b():
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()
  AilAg3.ReleaseCall()

def internal_14():
  """Internal call DN1 to DN2, two step transfer to DN3, completed before consulted party answer"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg2.CompleteTransfer()
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()

def internal_15():
  """Internal call, two step transfer to DN3, completed before consulted party answer, abnor"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg2.CompleteTransfer()
  AilAg1.ReleaseCall()

def internal_16():
  """Internal call DN1 to  DN2,  DN2 two step transfer to ACD3, release DN3"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(ACD3)
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()

def internal_17():
  """Internal call DN1 to  DN2, two step transfer to ACD3, agent NotReady-Ready, release DN3"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateTransfer(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg2.CompleteTransfer()
  AilAg3.ReleaseCall()

def internal_18():
  """Internal call DN1 to DN2, two step transfer to ACD3, completed before consulted party answer"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(ACD3)
  AilAg2.CompleteTransfer()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()

def internal_18a():
  """Internal call DN1-DN2, two step transfer to busy ACD3, completed before consulted party answer """
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateTransfer(ACD3)
  AilAg2.CompleteTransfer()
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()


def internal_19():
  """Internal call DN1-DN2, two step transfer to ACD3, completed before consulted party answer, abnor """
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateTransfer(ACD3)
  AilAg2.CompleteTransfer()
  AilAg1.ReleaseCall()
  AilAg3.SetReady()

def internal_20():
  """something"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()
  AilAg2.InitiateTransfer(DN1)
  AilAg2.CompleteTransfer()
  AilAg1.AnswerCall()
  AilAg3.ReleaseCall()  

def internal_21():
  """Internal call DN1 to DN2, internal conference to DN3, release DN1, DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def internal_22():
  """Internal call DN1 to DN2, DN2 cinit conference to DN3, abnorl release DN2, release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg2.ReleaseCall()
  AilAg1.ReleaseCall()

def internal_23():
  """Internal call DN1 to DN2, internal conference to ACD3, release DN1, DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def internal_23a():
  """Internal call DN1 to DN2, internal conference to ACD3, release DN1, DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()
  AilAg1.ReleaseCall()


def internal_24():
  """Internal call DN1 to DN2, DN2 init conference to ACD3, abnormal release DN2, release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg2.ReleaseCall()
  AilAg1.ReleaseCall()

def internal_25():
  """Internal call DN1 to DN2, internal conference to ACD3, agent NotReady-Ready"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.InitiateConference(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def internal_26():
  """Internal call DN1 to DN2, DN2 conference to DN3, completed before consulted party answer"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg2.CompleteConference()
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()
  AilAg2.ReleaseCall()

def internal_27():
  """Internal call DN1 to DN2, DN2 conf to DN3, compl before cons. party answer, abnor. release DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(DN3)
  AilAg2.CompleteConference()
  AilAg2.ReleaseCall()
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()

def internal_28():
  """Internal call DN1 to DN3, DN3 conference to ACD2, completed before cons. party answer"""
  AilAg1.MakeCall(DN3)
  AilAg3.AnswerCall()
  AilAg3.InitiateConference(ACD2)
  AilAg3.CompleteConference()
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()
  AilAg1.ReleaseCall()

def internal_29():
  """As above, but Agent NR-R"""
  AilAg1.MakeCall(DN3)
  AilAg3.AnswerCall()
  AilAg2.SetNotReady()
  AilAg3.InitiateConference(ACD2)
  AilAg2.SetReady()
  AilAg3.CompleteConference()
  AilAg2.AnswerCall()
  AilAg2.ReleaseCall()
  AilAg1.ReleaseCall()


def internal_30():
  """Internal call DN1 to DN2, mute transfer to DN3, release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(DN3)
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()

def internal_31():
  """Internal call DN1 to DN2, mute transfer to ACD3, release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(ACD3)
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()

def internal_32():
  """Internal call DN1 to DN2, mute transfer to ACD3, agent NotReady-Ready, release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.MuteTransfer(ACD3)
  AilAg3.SetReady()
  AilAg3.AnswerCall()
  AilAg1.ReleaseCall()

def internal_33():
  """Internal call DN1 to DN2, mute transfer to DN3, abnormal release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(DN3)
  AilAg1.ReleaseCall()

def internal_34():
  """Internal call DN1 to DN2, mute transfer to ACD3, agent NotReady-Ready, abnormal release DN1"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg3.SetNotReady()
  AilAg2.MuteTransfer(ACD3)
  AilAg1.ReleaseCall()
  AilAg3.SetReady()
  
def internal_35():
  """Internal call DN1 to ACD2, DN2 answer, DN2 mute transfer to ACD2, release DN1"""
  AilAg1.MakeCall(ACD2)
  AilAg2.AnswerCall()
  AilAg2.MuteTransfer(ACD2)
  AilAg1.ReleaseCall()
  
def internal_36():
  """Internal call DN1 to DN2, DN1 drops DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg1.DeleteFromConference(DN2)

def internal_37():
  """Internal call DN1 to ACD2,  DN1 drops  DN2"""
  AilAg1.MakeCall(ACD2)
  AilAg2.AnswerCall()
  AilAg1.DeleteFromConference(DN2)  

def internal_38():
  """Internal call DN1 to DN2, conference, DN1 drops DN3, release DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  AilAg1.DeleteFromConference(DN3)
  AilAg2.ReleaseCall()
  
def internal_39():
  """Internal call DN1 to DN2, conference, DN1 drops DN1, release DN2"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.InitiateConference(ACD3)
  AilAg3.AnswerCall()
  AilAg2.CompleteConference()
  AilAg1.DeleteFromConference(DN1)
  AilAg2.ReleaseCall()  

 
  
def internal_40():
  """Internal call DN1 to DN2, DN2 answer, DN2  SSC to DN3"""
  AilAg1.MakeCall(DN2)
  AilAg2.AnswerCall()
  AilAg2.SingleStepConference(DN3)
  AilAg3.ReleaseCall()
  AilAg1.ReleaseCall()


def internal_41():

  AilAg1.MakeCall(DN2)
  AilAg1.InitiateTransfer(DN3)
  AilAg2.AnswerCall()
  AilAg1.CompleteTransfer()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()  

def internal_42():

  AilAg1.MakeCall(DN2)
  AilAg1.InitiateTransfer(DN3)
  AilAg2.AnswerCall()
  AilAg3.AnswerCall()
  AilAg3.ReleaseCall()  
  AilAg1.RetrieveCall()
  AilAg1.ReleaseCall()

  
  


  

